package ui.actions;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

import ui.Main;
import util.Util;

/**
 * Action for new file.
 * @author TKington
 *
 */
public class NewAction extends AbstractAction {
	/** 
	 * Creates a new NewAction.
	 */
	public NewAction() {
		putValue(NAME, "New");
		putValue(SHORT_DESCRIPTION, "New File");
		putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
		putValue(SMALL_ICON, Util.getIcon("New16.gif")); //$NON-NLS-1$
	}
	
	public void actionPerformed(ActionEvent evt) {
		Main.frame.onNewFile();
	}
}
